#include "ItemObject.h"

#include "OgreFrameWork.h"
#include "CFGLoader.h"

#include "GameState.h"

#include "Util.h"

ItemObject::ItemObject()
{
    //ctor
//    setYOffset(0.5);
}

ItemObject::~ItemObject()
{
    //dtor
}


void ItemObject::init()
{
/*    Ogre::SceneManager *sceneMgr = OgreFramework::getSingletonPtr()->m_pRoot->getSceneManager("GameSceneMgr");

    OgreFramework::getSingletonPtr()->m_pLog->logMessage("ItemObject::Init() : node creation");


    m_node = sceneMgr->getRootSceneNode()->createChildSceneNode();




    m_entity =  sceneMgr->createEntity("mycube", "Prefab_Cube");

    m_node->attachObject(m_entity);
    /*

    Ogre::BillboardSet *billSet = sceneMgr->createBillboardSet();
    m_node->attachObject(billSet);
    billSet->createBillboard(addYtoVector2(getPosition()),Ogre::ColourValue(1.0));


        OgreFramework::getSingletonPtr()->m_pLog->logMessage("ItemObject::Init() : params loading");*/
/*
    std::map<std::string, std::string> params = CFGLoader::loadRessourceFile(Ogre::String("../data/item/")+m_type+".cfg");

    if (params.size()>1)
    {
        setYOffset(Ogre::StringConverter::parseReal(params["Yoffset"]));

        if (params.count("scale")>0)
        {

            float s = Ogre::StringConverter::parseReal(params["scale"]);
            m_node->setScale(Ogre::Vector3(s,s,s));
        }
    }
    else
    {
        OgreFramework::getSingletonPtr()->m_pLog->logMessage("WARNING :file for item "+m_type+" don't exist");
    }

        OgreFramework::getSingletonPtr()->m_pLog->logMessage("ItemObject::Init() : set Offset");



    m_node->setPosition(addYtoVector2(getPosition(),m_Yoffset));
*/
}

/** @brief update
*
* @todo: document this function
*/
void ItemObject::update(double timeSinceLastFrame)
{


}

/** @brief clear
*
* @todo: document this function
*/
void ItemObject::clear()
{

}
